package com.smdd.project.controller;

import com.smdd.project.entity.R;
import com.smdd.project.entity.UserInfo;
import com.smdd.project.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @ClassName HelloWorldController
 * @Description TODO
 * @Author wyp
 * @Date 2023/7/7 12:31
 * @Version 1.0
 */
@Api(tags = "用户管理API", description = "提供用户相关操作的接口")
@RestController
@RequestMapping("/user")
public class HelloWorldController {

    @Autowired
    private UserService userService;

    @ApiOperation("测试demo")
    @GetMapping("/findById")
    public R findById(@RequestParam("userId") String id) {
        UserInfo userInfo = userService.getUserInfo(id);
        return R.ok().put("data", userInfo);
    }
}
